﻿using Nemerle.Collections;
using Nemerle.Text;
using Nemerle.Utility;
using Nemerle;

using System;
using System.Collections.Generic;
using System.Linq;

class Lazyness {
  LazyCall([Lazy] value : int, flag : bool) : void {
    when (flag) {
      Console.Write(value); 
      // instead of 'Console.Write(value.Value)'; 
    }
    Console.Write("B");
  }
  
  public Oblomov() : void {
    def getValue()  {
      Console.Write("A");
      42
    }
    LazyCall(lazy(getValue()), false); //B
    LazyCall(lazy(getValue()), true);  //A42B
    LazyCall(24, true);                //24B
  }
}